import os
from functools import lru_cache

__all__ = ['path_config']

class PathConfig:

    @property
    def project_dir(self) -> str:
        '''

        :return: 项目路径
        '''
        _base_dir = os.path.dirname(os.path.dirname(__file__))
        return _base_dir


    @property
    def log_dir(self) -> str:
        """日志路径"""
        return os.path.join(self.project_dir, 'log')

    @property
    def report_dir(self) -> str:
        """导出路径"""
        return os.path.join(self.project_dir, 'report')

    @property
    def data_dir(self) -> str:
        """测试数据存放路径"""
        return os.path.join(self.project_dir, 'data')

    @property
    def conf_dir(self) -> str:
        """系统配置路径"""
        return os.path.join(self.project_dir, 'configs')


@lru_cache(maxsize=None)
def cache_path() -> PathConfig:
    return PathConfig()

path_config = cache_path()

if __name__ == '__main__':
    print(path_config.project_dir)